package com.md.lesson8;

import java.util.Scanner;

public class Power {
	public static void power(int m,int n) {
		int result = m;
		for(int i = 1;i <= n;i++) {
			if(i == 1) {
				result = m;
			}else {
				result = result*m;
			}
		}
		System.out.println("m的n次幂是：" + result);
		
	}

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		
		System.out.println("请输入底数");
		int m = s.nextInt();
		
		System.out.println("请输入指数");
		int n = s.nextInt();
		
		power(m,n);

	}

}
